package com.ju.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ju.demo.entity.Clientele;
import com.ju.demo.entity.Member;
import com.ju.demo.mapper.MemberMapper;
import com.ju.demo.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MemberServiceImpl implements MemberService {

    @Autowired
    private MemberMapper memberMapper;

    /**
     * 通过TeamID查询当前班级的所有成员
     * @param id
     */
    @Override
    public List<Member> findMembersByTeamID(Integer id) {
        QueryWrapper<Member> memberQueryWrapper = new QueryWrapper<>();
        memberQueryWrapper.eq("team_id",id);
        List<Member> members = memberMapper.selectList(memberQueryWrapper);
        return members;
    }
}
